package demo2;

public class Test2 {
    public static void main(String[] args) {
        MyArray<String> myArray = new MyArray<>() ;
        myArray.setArray(0 , "11");
        System.out.println(myArray.getArray(0));

    }
}

class MyArray<T>{

  Object[] array = new Object[10] ;

    public void setArray(int pos , T t) {
        this.array[pos] = t ;
    }

    public T getArray(int pos) {
        return (T)this.array[pos];
    }
     public Object[] getArrays(){
        return this.array ;
     }
}